<?php

namespace app\repository;


/**
 * Class BaseRepository
 * @package app\repository
 */
class BaseRepository
{
    private static array $_container = [];

    /**
     * 单例
     *
     * @return object|static
     */
    public static function getInstance()
    {
        $class = static::class;

        if (!isset(self::$_container[$class])) {
            $obj = new $class();
            self::$_container[$class] = $obj;
        }

        return self::$_container[$class];
    }
}